package com.triplelink.business.impl.rush;

import com.triplelink.context.Connector;

public class EntityTSManagerRush extends EntityTSManagerRushBase
{
	public EntityTSManagerRush(Connector connector)
	{
		super(connector);
	}

	@Override
	public <T> T find(String id, Class<T> entityClass)
	{
		getConnection();
		
		T entity = getEntityDAO().find(id, entityClass, getAbox());
		
		closeConnection();
		
		return entity;
	}

	@Override
	public <T> T merge(T entity)
	{
		getConnection();
		
		getEntityDAO().merge(entity, getAbox());
		
		closeConnection();
		
		return entity;
	}

	@Override
	public <T> T persist(T entity)
	{
		getConnection();
		
		getEntityDAO().save(entity, getAbox());
		
		closeConnection();
		
		return entity;
	}

	@Override
	public <T> void remove(T entity)
	{
		getConnection();
		
		getEntityDAO().delete(entity, getAbox());
		
		closeConnection();
	}
}
